import request from '@/utils/rquest';
import { addCommonHeaders } from './user';

// 获取车辆列表
export function getVehicleList() {
  const config = {
    url: '/v1.0/app/cfmotoserverapp/vehicleHomePage',
    method: 'get',
  };
  
  return request(addCommonHeaders(config, false));
}

// 获取车辆详情
export function getVehicleDetail(vinNo) {
  const config = {
    url: '/v1.0/mine/cfmotoservermine/vehicle/detail',
    method: 'get',
    params: { vinNo },
  };
  
  return request(addCommonHeaders(config, false));
}

// 获取车辆公里数详情
export function getMileageDetail(vinNo) {
  const config = {
    url: '/v1.0/app/cfmotoserverapp/rideInfo',
    method: 'get',
    params: { vinNo },
  };
  
  return request(addCommonHeaders(config, false));
}

// 获取骑行详情
export function getRidingDetail(vinNo, date) {
  const config = {
    url: '/v1.0/app/cfmotoserverapp/rideDayInfo',
    method: 'get',
    params: { vinNo, date },
  };
  
  return request(addCommonHeaders(config, false));
} 

// 获取车辆电池信息
export function getBatteryInfo(vinNo) {
  const config = {
    url: '/v1.0/app/cfmotoserverapp/batteryInfo/' + vinNo,
    method: 'get',
  };
  
  return request(addCommonHeaders(config, false));
}

// 获取电池详情信息
export function getBatteryDetailInfo(deviceId) {
  const config = {
    url: '/v1.0/app/cfmotoserverapp/batteryInfo/detail/' + deviceId,
    method: 'get',
  };
  
  return request(addCommonHeaders(config, false));
}

// 获取某月骑行数据
export function getRideMonthInfo(vinNo, month) {
  const config = {
    url: '/v1.0/app/cfmotoserverapp/rideMonthInfo',
    method: 'get',
    params: { vinNo, month },
  };
  
  return request(addCommonHeaders(config, false));
} 